#ifndef _CONNECTOR_INC
#define _CONNECTOR_INC

#include "TcpConduit.h"

namespace Network
{

class Connector:
	public TcpConduit
{
public:
	Connector(int fd, TcpSlaveServer * s, int id, const std::string& ip, UInt16 port);
	~Connector();

protected:
	virtual UInt16 parsePacket(struct evbuffer * buf, int &off, int &len);
	virtual void send(const void *, int);
	virtual void onRecv(UInt16 cmd, int len, void * buf);
	virtual void onConnected();

	virtual void onDisconnected();

public:
	virtual bool active() { return false; }

private:
	bool _connected;
};

}

#endif // _CONNECTOR_INC
